// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: (h) => h('router-view')
}

export const asyncRouterMap = [

  {
    path: '/index',
    name: 'index',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    redirect: '/idPhoto',
    children: [

      // {
      //   path: '/dashboard',
      //   name: 'Dashboard',
      //   hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
      //   component: () => import('@/views/dashboard/Dashboard'),
      //   meta: { title: '首页', keepAlive: true, icon: bxAnaalyse }
      // },
      {
        path: '/idPhoto',
        name: 'news',
        component: RouteView,
        redirect: '/idPhoto/make',
        meta: { title: '证件管理', icon: 'table', code: '2' },
        children: [
          {
            path: '/idPhoto/make',
            name: 'NewsTypes',
            hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
            component: () => import('@/views/certiticate/makeCert/Types'),
            meta: { title: '证件制作', keepAlive: true, code: '2' },
          },
          {
            path: '/idPhoto/manage',
            name: 'NewsList',
            hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
            component: () => import('@/views/certiticate/giveCert/List'),
            meta: { title: '发证管理', keepAlive: true, code: '2' }
          }
        ]
      },
      {
        path: '/administer',
        name: 'Administer',
        component: RouteView,
        redirect: '/administer/basic',
        meta: { title: '账号管理', icon: 'team', code: '2' },
        children: [
          {
            path: '/administer/basic',
            name: 'NavManage',
            hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
            component: () => import('@/views/admin/adminBasic/Index'),
            meta: { title: '基本信息', keepAlive: true, icon: 'user', code: '2' }
          },
          {
            path: '/administer/userList',
            name: 'UserList',
            hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
            component: () => import('@/views/admin/userList'),
            meta: { title: '用户列表', keepAlive: true, icon: 'user-delete', code: '2' }
          },
          {
            path: '/administer/operate',
            name: 'Operate',
            hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
            component: () => import('@/views/admin/operate'),
            meta: { title: '运营人员', keepAlive: true, icon: 'usergroup-delete', code: '2' }
          },
          {
            path: '/administer/sealManage',
            name: 'SealManage',
            hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
            component: () => import('@/views/admin/sealManage'),
            meta: { title: '印章管理', keepAlive: true, icon: 'pushpin', code: '2' }
          },
        ]
      },


      // {
      //  path: '/reservedWord/list',
      //  name: 'ReservedWord',
      //  hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
      //  component: () => import('@/views/reservedWord/Index'),
      //  meta: { title: '保留词列表', icon: 'font-size', keepAlive: true, code: '4' }
      // },
      // {
      //   path: '/user/manage',
      //   name: 'UserManage',
      //   hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
      //   component: () => import('@/views/userManage/Index'),
      //   meta: { title: '用户管理', keepAlive: true, icon: 'user', code: '1' }
      // }

    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/',
    hidden: true,
    component: () => import(/* webpackChunkName: "home-index" */ '@/views/home'),
    children: [
      {
        path: '',
        name: "Home",
        component: () => import(/* webpackChunkName: "home-home" */ '@/views/home/home')
      },
      {
        path: 'about',
        name: "About",
        component: () => import(/* webpackChunkName: "home-about" */ '@/views/home/about')
      },
      {
        path: 'offer',
        name: "Offer",
        component: () => import(/* webpackChunkName: "home-offer" */ '@/views/home/offer')
      },
    ]
  },
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/wxLogin')
        // component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      // {
      //   path: 'password',
      //   name: 'password',
      //   component: () => import(/* webpackChunkName: "user" */ '@/views/user/ResetPassword')
      // }
    ]
  },
  {
    path: '/agreement',
    name: 'Agreement',
    component: () => import(/* webpackChunkName: "agreement" */ '@/views/user/httpText.vue')
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },
  {
    path: '/403',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403')
  }

]
